import type { XtxGuessInstance } from '@/types/components'
import { ref } from 'vue'

/**
 * 猜你喜欢组件组合式函数封装
 * @returns XtxGuess 组件实例和滚动触底事件
 */
export const useXtxGuessList = () => {
  // 获取 XtxGuess 实例
  const guessRef = ref<XtxGuessInstance>()
  // 滚动触底事件
  const scrollToLower = () => {
    guessRef.value?.getHomeGuess()
  }

  return {
    guessRef,
    scrollToLower
  }
}
